package com.xbongbong.workflow.domain.dao;

import com.xbongbong.workflow.domain.entity.WorkflowEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Mapper
@Repository
public interface WorkflowDao {
    Integer insert(WorkflowEntity entity);

    void insertBatch(List<WorkflowEntity> list);

    WorkflowEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid );

    Integer update(WorkflowEntity entity);

    List<WorkflowEntity> findEntities(@Param("param") Map<String, Object> param);

    Integer getEntitiesCount(@Param("param") Map<String, Object> param);

    Integer deleteByKey(@Param("key") Long key, @Param("corpid") String corpid);
    /**
     * 批量删除
     * @param key
     * @param corpid
     * @return
     */
    Integer deleteBatch(@Param("idIn")List<Long> key, @Param("corpid")String corpid);

    /**
     * 批量排序
     * @param list
     * @param corpid
     * @return
     */
    Integer updatePriority(@Param("list")List<WorkflowEntity> list, @Param("corpid")String corpid);
}